<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="centre/manage/include :: header">
</head>

<link rel="stylesheet" type="text/css" href="/css/plugins/layui/layui.css"/>
<link href="/css/jquery-select/jquery.searchableSelect.css" rel="stylesheet" type="text/css">
<style>
	.province {
		float: left;
		position: relative;
		width: 150px;
		height: 35px;
		line-height: 35px;
		border: 1px solid #fff;
	}

	.province:hover {
		border: 1px solid #f7e4a5;
		border-bottom: 1px solid #fffec6;
		background: #fffec6;
	}

	.province .cityall {
		margin-top: 10px;
	}

	.province ul {
		list-style: outside none none;
		position: absolute;
		padding: 0;
		background: #fffec6;
		border: 1px solid #f7e4a5;
		display: none;
		width: auto;
		width: 300px;
		z-index: 999999;
		left: -26px;
		top: 33px;
	}

	.province ul li {
		float: left;
		min-width: 60px;
		margin-left: 20px;
		height: 30px;
		line-height: 30px;
	}

	.province .checkbox-inline {
		padding-top: 0;
	}

	h3, h4, h5 {
		margin: 5px 0;
		font-weight: 600;
	}

	input[type=email], input[type=url], input[type=search], input[type=tel],
	input[type=color], input[type=text], input[type=password], input[type=datetime],
	input[type=datetime-local], input[type=date], input[type=month], input[type=time],
	input[type=week], input[type=number], textarea {
		border-radius: 0 !important;
		color: #858585;
		background-color: #FFF;
		border: 1px solid #D5D5D5;
		padding: 5px 4px 6px;
		font-size: 14px;
		font-family: inherit;
		-webkit-box-shadow: none !important;
		box-shadow: none !important;
		-webkit-transition-duration: .1s;
		transition-duration: .1s;
	}
	.spectable td, .spectable th {
		border: 1px solid #ccc;
		vertical-align: middle;
		text-align: center;
	}

	.spectable th {
		font-weight: bold;
	}

	.spectableinput {
		text-align: center;
	}

	.f {
		border-color: #b94a48;
		-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
	}

	.table.table-bordered tr th, .table.table-bordered tr td {
		overflow: hidden;
		text-overflow: ellipsis;
	}
	select {
		padding: 3px 4px;
		height: 30px;
	}

	/* .tags {
      display: inline-block;
      padding: 4px 6px;
      color: #777;
      vertical-align: middle;
      background-color: #FFF;
      border: 1px solid #D5D5D5;
      width: 206px;
  } */
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
	<div class="row">
		<div class="col-sm-12">
			<div class="form-horizontal m-t">
				<div class="form-group">
					<ul class="nav nav-arrow-next nav-tabs" id="myTab">
						<li class="active"><a href="#tab_basic">基本信息</a></li>
						<li><a href="#tab_des">商品描述</a></li>
						<li><a href="#tab_postage">邮费设置</a></li>
						<li><a href="#tab_commission">佣金费设置</a></li>
						<li><a href="#tab_option">商品规格</a></li>

						<li><a href="#tab_areas">商品售卖区域</a></li>
					</ul>
				</div>
				<div class="tab-content" style="border: 0px;">
					<div class="tab-pane active" id="tab_basic">
						<div class="form-group">
							<label class="col-sm-2 control-label">排序:</label>
							<div class="col-sm-6">
								<input id="displayorder" name="displayorder"
											 class="form-control" type="text" maxlength="10">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">数字越大，排名越靠前,限制小于2147483647</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品名称:</label>
							<div class="col-sm-6">
								<input id="title" name="title" placeholder="必填：商品名称"
											 class="form-control" type="text" maxlength="20"> <input id="productid" name="id" type="hidden">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left;color:red;">*商品标题(20个汉字以内)</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品短标题:</label>
							<div class="col-sm-6">
								<input id="shortTitle" name="shortTitle" placeholder="商品短标题"
											 class="form-control" type="text" maxlength="8">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">打印专用短标题(8个汉字以内)</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品编号:</label>
							<div class="col-sm-6">
								<input id="goodscode" name="goodscode" placeholder="商品编号"
											 class="form-control" type="text">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">识别商品的唯一编号</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品型号:</label>
							<div class="col-sm-6">
								<input id="specTitle" name="specTitle" class="form-control"
											 type="text">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">商品型号是商品售卖的规格描述，用于商品统计</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">生产日期:</label>
							<div class="col-sm-6">
								<input id="manudate" name="manudate" class="form-control"
											 type="text">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品保质期:</label>
							<div class="col-sm-6">
								<input id="guarantday" name="guarantday" class="form-control"
											 type="text">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 商品分类： </label>
							<div class="col-sm-10">
								<div class="row row-fix tpl-category-container">
									<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
										<select class="form-control tpl-category-parent" id="pcate"
														name="pcate" onchange="renderCategoryThird(this)">
											<option value="0">请选择顶级分类</option>
											<option th:each="item: ${category}" th:text="${item.name}"
															th:value="${item.id}"></option>

										</select>
									</div>
									<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
										<select class="form-control tpl-category-child" id="ccate"
														name="ccate">
											<option value="0">请选择下级分类</option>
										</select>
									</div>
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">供应商:</label>
							<div class="col-sm-8">
								<select data-placeholder="" class="form-control chosen-select"
												id="supplierId" name="supplierId">
									<option th:value="0">请选择供应商</option>
									<option th:each="item: ${supply}" th:text="${item.name}"
													th:value="${item.id}"></option>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">单位:</label>
							<div class="col-sm-6">
								<input id="unit" name="unit" placeholder="单位如件/斤/袋"
											 class="form-control" type="text">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">单位如件/斤</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">商品属性:</label>
							<div class="col-sm-10">
								<!-- <label for="isrecommand" class="checkbox-inline">
                  <input type="checkbox" name="isrecommand" value="1" id="isrecommand" /> 推荐
                </label>  -->
								<!--<label for="iszhicai" class="checkbox-inline">-->
									<!--<input type="checkbox" name="iszhicai" value="1" id="iszhicai" /> 直采-->
								<!--</label>-->
								<label for="isnew" class="checkbox-inline">
									<input type="checkbox" name="isnew" value="1" id="isnew" /> 新品
								</label>
								<label for="ishot" class="checkbox-inline">
									<input type="checkbox" name="ishot" value="1" id="ishot" /> 爆款
								</label>
								<label for="ismao" class="checkbox-inline">
									<input type="checkbox" name="ismao" value="1" id="ismao" /> 特卖
								</label>
								<!--<label for="isfanchang" class="checkbox-inline">-->
									<!--<input type="checkbox" name="isfanchang" value="1" id="isfanchang" /> 返场-->
								<!--</label>-->
								<!-- <label for="isgerida" class="checkbox-inline">
                  <input type="checkbox" name="isgerida" value="1" id="isgerida" /> 隔日达
                </label>  -->
								<!-- <label for="isdiscount" class="checkbox-inline">
                  <input type="checkbox" name="isdiscount" value="1" id="isdiscount" /> 促销
                </label>
                <label for="istime" class="checkbox-inline">
                  <input type="checkbox" name="istime" value="1" id="istime" /> 限时卖
                </label>  -->
								<!-- <label for="ismiaosha" class="checkbox-inline">
                  <input type="checkbox" name="ismiaosha" value="1" id="ismiaosha" /> 秒杀
                </label>  -->
								<!--<label for="islimited" class="checkbox-inline">-->
									<!--<input type="checkbox" name="islimited" value="1" id="islimited" /> 限量-->
								<!--</label>-->
								<!--<label for="isfashi" class="checkbox-inline">-->
									<!--<input type="checkbox" name="isfashi" value="1" id="isfashi" /> 假一罚十-->
								<!--</label>-->
								<!--<label for="isbig" class="checkbox-inline">-->
									<!--<input type="checkbox" name="isbig" value="1" id="isbig" /> 包邮-->
								<!--</label>-->
								<!--<label for="isvip" class="checkbox-inline">-->
									<!--<input type="checkbox" name="isvip" value="1" id="isvip" /> vip-->
								<!--</label>-->
								<!--<label for="isTeamBuy" class="checkbox-inline">-->
									<!--<input type="checkbox" name="isTeamBuy" value="1" id="isTeamBuy" /> 门店采购-->
								<!--</label>-->
								<!--<label for="iszhutihuakuang" class="checkbox-inline">-->
									<!--<input type="checkbox" name="iszhutihuakuang" value="1" id="iszhutihuakuang" /> 主题画框-->
								<!--</label>-->
								<!-- <label for="isSpellgroup" class="checkbox-inline">
                  <input type="checkbox" name="isSpellgroup" value="1"
                  id="isSpellgroup" /> 拼团
                </label>
                <label for="ispresell" class="checkbox-inline">
                  <input type="checkbox" name="ispresell" value="1" id="ispresell" /> 预售
                </label>  -->
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">自定义属性:</label>
							<div class="col-sm-6">
								<input id="selfvalue" name="selfvalue"
											 placeholder="如：年末促销,清仓处理" class="form-control" type="text">
							</div>
							<label class="col-sm-2 control-label" style="text-align: left">自定义添加商品属性，多个用','隔开。如：年末促销,清仓处理</label>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 限卖时间： </label>
							<div class="col-sm-10">
								<div class="col-sm-4 col-xs-6">
									<!-- <input type="text" name="timestart" id="timestart"
                    value="" placeholder="请选择日期时间"
                    onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                    readonly="readonly" class="datetimepicker form-control"
                    style="padding-left: 12px;" /> -->
									<input type="text" name="timestart" id="timestart"
												 placeholder="请选择日期时间"
												 readonly="readonly" class="layui-input form-control"
												 style="padding-left: 12px;">
								</div>
								<div class="col-sm-4 col-xs-6">
									<input type="text" name="timeend" value="" id="timeend"
												 placeholder="请选择日期时间" readonly="readonly"
												 class="layui-input form-control"
												 style="padding-left: 12px;" />
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 商品图片： </label>
							<div class="col-sm-10">
								<div class="col-sm-6">
									<div class="input-group ">
										<input type="text" name="thumb" id="thumb" value="" class="form-control"
													 autocomplete="off">
										<span class="input-group-btn">
												<button class="btn btn-sm btn-default" type="button"  style="padding:7px 10px"
																onclick="onSelectImgBtnClick('thumb','thumbImg')"
												>选择图片</button>
											</span>
									</div>
									<div class="input-group " style="margin-top:.5em;">
										<img src="" id="thumbImg" style="max-width: 30%"/>
									</div>
								</div>
								<span class="lbl col-xs-12 col-sm-6">
										<span style="color:red;">*商城首页显示的第一张图片</span>
									</span>
							</div>
						</div>


						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 商品正方形图片： </label>
							<div class="col-sm-10">
								<div class="col-sm-6">
									<div class="input-group ">
										<input type="text" name="thumbSquare" id="thumbSquare" value=""
													 class="form-control" autocomplete="off">
										<span class="input-group-btn">
												<button class="btn btn-sm btn-default" type="button" style="padding:7px 10px"
																onclick="onSelectImgBtnClick('thumbSquare','thumbSquareImg');">选择图片</button>
											</span>
									</div>
									<div class="input-group " style="margin-top: .5em;">
										<img src="" id="thumbSquareImg" style="max-width: 30%"/>
									</div>
								</div>
								<span class="lbl col-xs-12 col-sm-6"><span class="red"></span>如不上传此图默认其他图片第一张图片作为正方形图片</span>
							</div>
						</div>


						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1">使用视频： </label>
							<div class="col-sm-10">
								<div class="col-sm-6">
									<div class="input-group">
										<input type="text" value="" name="videourl" id="videourl"
													 class="form-control" autocomplete="off">
										<span class="input-group-btn">
												<button class="btn btn-sm btn-default" style="padding:7px 10px"
																onclick="onSelectVideoBtnClick('videourl','videourl1');">选择媒体文件</button>
											</span>
									</div>
								</div>
								<span class="lbl col-xs-12 col-sm-6"><span class="red"></span>优先显示视频，使用视频后，其他图片的第一张图传缩略图，比列应该要和视频一样。</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1">其他图片:</label>
							<div class="col-sm-10">
								<div class="col-sm-6">
									<div class="input-group ">
										<input type="text" name="thumbUrl" id="thumbUrl" value=""
													 class="form-control" autocomplete="off" placeholder="批量上传图片">
										<span class="input-group-btn">
												<button class="btn btn-sm btn-default" type="button" style="padding:7px 10px"
																onclick="selectImgs('thumbUrl');">选择图片</button>
											</span>
									</div>
									<div class="input-group" style="margin-top: .5em;" id="imgDiv">

									</div>
								</div>
								<span class="lbl col-xs-12 col-sm-6"><span class="red"></span>如不上传此图默认其他图片第一张图片作为正方形图片</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 商品价格： </label>
							<div class="col-sm-6">
								<div class="input-group form-group">
									<span class="input-group-addon">建议零售价</span>
									<input type="text" name="suggestsaleprice" id="suggestsaleprice"
												 class="form-control" value="" />
									<span class="input-group-addon">元 </span>
								</div>
								<div class="input-group form-group">
									<span class="input-group-addon">现价</span>
									<input type="text" name="marketprice" id="marketprice"
												 class="form-control" value="" />
									<span class="input-group-addon">元 </span>
								</div>

								<div class="input-group form-group">
									<span class="input-group-addon">原价</span>
									<input type="text" name="productprice" id="productprice"
												 class="form-control"  value="" />
									<span class="input-group-addon">元</span>
								</div>
								<div class="input-group form-group">
									<span class="input-group-addon">成本价</span>
									<input type="text" name="costprice" id="costprice"
												 class="form-control" value="" />
									<span class="input-group-addon">元</span>
								</div>
								<div class='help-block'>
									<span style="color:red;">*现价：商品当前的销售价格，</span>
									<span style="color:red;">原价：商品最初的价格，</span>
									成本价(非必填项)：商品的成本价格
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 重量： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="weight" id="weight"
												 class="form-control" value="" />
									<span class="input-group-addon">克</span>
								</div>
								<div class='help-block'>商品重量设置空或0，则为包邮，如启用多规格，多规格内也需进行设置</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 库存： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="total" id="total"  class="form-control"
												 value="" />
									<span class="input-group-addon">件</span>
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 拼团人数： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="spellgroupnum" id="spellgroupnum"  class="form-control"
												 value="" />
									<span class="input-group-addon">数</span>
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 单次购买量： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="maxbuy" id="maxbuy"
												 class="form-control" value="0" />
									<span class="input-group-addon">件</span>
								</div>
								<span class="help-block">默认为0，表示不限制，用户单次购买此商品数量限制</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 用户最多购买量： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="usermaxbuy" id="usermaxbuy" class="form-control"
												 value="0" id="usermaxbuy"/>
									<span class="input-group-addon">件</span>
								</div>
								<span class="help-block">默认为0，表示不限制，用户购买过的此商品数量限制</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 门店最低购买量： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="startLimit" id="startLimit" class="form-control"
												 value="0" id="startLimit"/>
									<span class="input-group-addon">件</span>
								</div>
								<span class="help-block">默认为0，表示不限制，门店购买此商品数量最低限制</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 已出售数： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="sales" id="sales"
												 class="form-control" value="" />
									<span class="input-group-addon">件</span>
								</div>
								<span class="help-block">物品虚拟出售数，会员下单此数据就增加, 无论是否支付</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 已关注数： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="viewcount" id="viewcount"
												 class="form-control" value="" />
									<span class="input-group-addon">件</span>
								</div>
								<span class="help-block">物品虚拟关注数，会员查看商品详细此数据就增加, 无论是否支付</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 赠送积分： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="credit" id="credit"
												 class="form-control" value="" /> <span
										class="input-group-addon">分</span>
								</div>
								<p class="help-block">会员购物赠送的积分,
									如果不填写或填写0，则默认为不赠送积分，如果带%则为按成交价格的比例计算积分</p>
								<p class="help-block">如: 购买2件，设置10 积分, 不管成交价格是多少，
									则购买后获得20积分</p>
								<p class="help-block">如: 购买2件，设置10%积分, 成交价格2 * 200= 400，
									则购买后获得 40 积分（400*10%）</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 是否上架： </label>
							<div class="col-sm-10" style="padding-top: 5px;">
								<label for="isshow1" class="radio-inline">
									<input type="radio" onclick='radioIsChecked()'
												 name="status" value="1" id="isshow1" /> 是
								</label> &nbsp;&nbsp;&nbsp;
								<label for="isshow2" class="radio-inline">
									<input type="radio" onclick='radioIsChecked()' name="status"
												 value="0" id="isshow2" checked="checked" /> 否</label> &nbsp;&nbsp;&nbsp;
								<label for="isshow3" class="radio-inline"><input
										type="radio" onclick='radioIsChecked()' name="status"
										value="2" id="isshow3" /> 按时间范围上架</label> <span class="help-block"></span>
							</div>
						</div>

						<div class="form-group" id='shangjiadiv' style='display: none;'>
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 上架时间范围： </label>
							<div class="col-sm-10">
								<div class="col-sm-4 col-xs-6">
									<input type="text" name="upStartTime" id="upStartTime"
												 placeholder="请选择日期时间"
												 readonly="readonly" class="layui-input form-control"
												 style="padding-left: 12px;">
									<!--<input type="text" name="upStartTime" id="upStartTime"
                    value="" placeholder="请选择日期时间"
                    onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                    readonly="readonly" class="datetimepicker form-control"
                    style="padding-left: 12px;" />-->
								</div>
								<div class="col-sm-4 col-xs-6">
									<script type="text/javascript">

									</script>
									<input type="text" name="upEndTime" id="upEndTime"
												 placeholder="请选择日期时间"
												 readonly="readonly" class="layui-input form-control"
												 style="padding-left: 12px;">
									<!--<input type="text" name="upEndTime" id="upEndTime"
                    value="" placeholder="请选择日期时间"
                    onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
                    readonly="readonly" class="datetimepicker form-control"
                    style="padding-left: 12px;" />-->
								</div>

							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 是否开启公益金： </label>
							<div class="col-sm-10" style="padding-top: 5px;">
								<label for="gongyiisshow0" class="radio-inline">
									<input type="radio" onclick='gongyiIsChecked()' name="isgongyi"
												 value="0" id="gongyiisshow0" checked/> 不开启
								</label> &nbsp;&nbsp;&nbsp;
								<label for="gongyiisshow1" class="radio-inline">
									<input type="radio" onclick='gongyiIsChecked()' name="isgongyi"
												 value="1" id="gongyiisshow1" /> 开启
								</label>
								<span class="help-block"></span>
							</div>
						</div>

						<div class="form-group" id='gongyidiv' style='display:none'>
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 捐助公益金： </label>
							<div class="col-sm-6">
								<div class="input-group">
									<input type="text" name="gongyiprice" id="gongyiprice"
												 class="form-control" value="0.03" />
									<span class="input-group-addon">元</span>
								</div>
								<span class="help-block">公益金在系统自动收获时添加添加到公益资金池</span>
							</div>
						</div>


						<div class="form-group" id='' style=''>
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 是否显示供应商： </label>
							<div class="col-sm-6">
								<label for="showsupply1" class="radio-inline"><input
										type="radio" name="showsupply" value="1" id="showsupply1" />
									显示</label> &nbsp;&nbsp;&nbsp; <label for="showsupply2"
																											 class="radio-inline"><input type="radio"
																																									 name="showsupply" value="2" id="showsupply2" checked="checked" />
								不显示</label> <span class="help-block">默认显示供应商，前端页面标识商品供应商</span>
							</div>
						</div>

						<div class="form-group" style=''>
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 是否可以取消： </label>
							<div class="col-sm-6">
								<label for="uncancelable1" class="radio-inline">
									<input type="radio" name="uncancelable" value="1" id="uncancelable1" />
									不能取消
								</label> &nbsp;&nbsp;&nbsp;
								<label for="uncancelable2" class="radio-inline">
									<input type="radio" name="uncancelable" value="0"
												 id="uncancelable2" checked="checked" /> 可以取消
								</label>
								<span class="help-block">生成订单时将不能取消不能退款，默认可以取消</span>
							</div>
						</div>

						<div class="form-group" style=''>
							<label class="col-sm-2 control-label no-padding-right">商品类型:</label>
							<div class="col-sm-6">
								<label class="radio-inline">
									<input type="radio" name="productType" value="0"/>普通商品
								</label>
								<label class="radio-inline">
									<input type="radio" name="productType" value="1"/>预售商品
								</label>
<!--								<label class="radio-inline">-->
<!--									<input type="radio" name="productType" value="2"/>拼团商品-->
<!--								</label>-->
<!--								<label class="radio-inline">-->
<!--									<input type="radio" name="productType" value="3"/>秒杀商品-->
<!--								</label>-->
								<label class="radio-inline">
									<input type="radio" name="productType" value="4"/>预约商品
								</label>
								<label class="radio-inline">
									<input type="radio" name="productType" value="5"/>积分兑换商品
								</label>
								<label class="radio-inline">
									<input type="radio" name="productType" value="6"/>餐饮商品
								</label>
								<label class="radio-inline">
									<input type="radio" name="productType" value="7"/>其他商品
								</label>
							</div>
						</div>
					</div>


					<!-- 商品描述部分 开始 -->
					<div class="tab-pane" id="tab_des">
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1">商品详情</label>
							<div class="col-sm-10">
									<textarea id="content" name="content"
														style="height: 200px;">
									</textarea>
							</div>
						</div>


						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1">商品描述</label>
							<div class="col-sm-10">
									<textarea id="proddes" name="proddes"
														style="height: 200px;width: 500px">
									</textarea>
							</div>
						</div>
					</div>
					<!-- 商品描述部分 结束-->

					<!-- 邮费设置部分 开始 -->
					<div class="tab-pane" id="tab_postage">
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 提货时间： </label>
							<div class="col-sm-6">
								<input type="text" name="tihuoday" id="tihuoday" value=""
											 class="col-xs-10 col-sm-8">
								<div class="input-group-addon"
										 style="width: 50px; height: 34px;">
									<span style="font-size: 18px;">分钟</span>
								</div>
								<span style="padding-left: 10px; line-height: 35px;">
										预计发货节点后多少分钟可到货，无则表示采用<a>系统设置</a>
									</span>
							</div>
						</div>
						<div class="space-4"></div>
						<input type="hidden" id="free_shipping" value="">
						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> 邮费设置： </label>
							<div class="col-sm-6">
								<label for="totalcnf1" class="radio-inline">
									<input type="radio" name="free_shipping" value="0"
												 id="totalcnf1" checked="checked" /> 包邮
								</label> &nbsp;&nbsp;&nbsp;
								<label for="totalcnf2" class="radio-inline">
									<input type="radio" name="free_shipping" value="1"
												 id="totalcnf2" />独立邮费
								</label>
								<label for="totalcnf2" style="padding-left: 10px;">
									<input type="text" name="sendprice" id="sendprice"
												 style="float: left; width: 100px;" value="" />&nbsp;&nbsp;
								</label>&nbsp;&nbsp;&nbsp;
								<label for="totalcnf3" class="radio-inline">
									<input type="radio" name="free_shipping" value="2"
												 id="totalcnf3" /> 邮费模板
								</label>
								<label for="totalcnf3" style="padding-left: 10px; width: 300px;">
									<select name="dispatchid" id='dispatchid' class="form-control">
										<option value="0">请选择邮费模板</option>
										<option th:each="item: ${dispatch}" th:text="${item.dispatchname}"
														th:value="${item.id}"></option>
									</select>
								</label>
							</div>
						</div>
					</div>
					<!-- 邮费设置部分 结束 -->



					<!-- 佣金费设置部分 开始 -->
					<div class="tab-pane" id="tab_commission">
						&nbsp;
						<!--<div class="form-group">-->
							<!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启门店佣金:</label>-->
							<!--<div class="col-sm-9 col-xs-12">-->
								<!--<label class="checkbox-inline">-->
									<!--<input type="checkbox" id="is_fx_commission" value="1"-->
												 <!--name="is_fx_commission" />开启门店佣金-->
								<!--</label>-->
								<!--<span class="help-block">关闭后，将不给门店返佣。佣金设置的金额和比例都为0.00表示采用-->
										<!--<a>系统设置</a>的提成比例计算佣金-->
									<!--</span>-->
							<!--</div>-->
						<!--</div>-->


						<!--<div class="form-group">-->
							<!--<label class="col-sm-2 control-label no-padding-right"-->
										 <!--for="form-field-1"> 佣金设置： </label>-->
							<!--<div class="col-sm-6">-->
								<!--<label for="totalcnf2" class="radio-inline">门店佣金设置&nbsp;&nbsp;&nbsp;</label>-->
								<!--<label for="totalcnf2" style="padding-left: 10px;"> <input-->
										<!--type="text" name="headcommission" id="headcommission"-->
										<!--style="float: left; width: 100px;" disabled value="0" />&nbsp;-->
								<!--</label>-->
								<!--<label class="radio-inline" style="padding:9px 0px 0px 0px;width:40px;">-->
									<!--<select name="headtype" id="headtype" style="height: 34px;"onchange="changeVal()">-->
										<!--<option value="0">元</option>-->
										<!--<option value="1">%</option>-->
									<!--</select>-->
								<!--</label>-->
							<!--</div>-->
						<!--</div>-->


						<!--<div class="form-group">-->
							<!--<label class="col-sm-2 control-label no-padding-right"-->
										 <!--for="form-field-1"> </label>-->
							<!--<div class="col-sm-6">-->
								<!--<label for="totalcnf2" class="radio-inline">门店推荐人佣金 </label>-->
								<!--<label for="totalcnf2" style="padding-left: 10px;">-->
									<!--<input type="text" name="superiorcommission" id="superiorcommission"-->
												 <!--style="float:left;width:100px;" disabled value="0" />&nbsp;-->
								<!--</label>-->
								<!--<label class="radio-inline" style="padding:9px 0px 0px 0px;width: 40px;">-->
									<!--<select name="superiortype" id="superiortype" style="height: 34px;"onchange="changeValue()">-->
										<!--<option value="0">元</option>-->
										<!--<option value="1">%</option>-->
									<!--</select>-->
								<!--</label>-->
							<!--</div>-->
						<!--</div>-->

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> </label>
							<div class="col-sm-6">
								<label for="totalcnf2" class="radio-inline">用户推荐人佣金 </label>
								<label for="totalcnf2" style="padding-left: 10px;">
									<input type="text" name="usercommission" id="usercommission"
												 style="float:left;width:100px;" disabled value="0" />&nbsp;
								</label>
								<label class="radio-inline" style="padding:9px 0px 0px 0px;width: 40px;">
									<select name="usertype" id="usertype" style="height: 34px;"onchange="changeValue2()">
										<option value="0">元</option>
										<option value="1">%</option>
									</select>
								</label>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label no-padding-right"
										 for="form-field-1"> </label>
							<div class="col-sm-6">
								<label for="totalcnf2" class="radio-inline">用户2级推荐人佣金 </label>
								<label for="totalcnf2" style="padding-left: 10px;">
									<input type="text" name="superusercommission" id="superusercommission"
												 style="float:left;width:100px;" disabled value="0" />&nbsp;
								</label>
								<label class="radio-inline" style="padding:9px 0px 0px 0px;width: 40px;">
									<select name="superusertype" id="superusertype" style="height: 34px;"onchange="changeValue3()">
										<option value="0">元</option>
										<option value="1">%</option>
									</select>
								</label>
							</div>
						</div>
					</div>
					<!-- 佣金费设置部分 结束 -->

					<!-- 商品规格部分  开始 -->
					<div class="tab-pane" id="tab_option">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否启用商品规格</label>
							<div class="col-sm-9 col-xs-12">

								<label class="checkbox-inline"> <input type="checkbox"
																											 id="hasoption" value="1" name="hasoption" />启用商品规格
								</label>
								<label class="checkbox-inline" id='second_speccid'
											 style="display: none"> <input type="checkbox"
																										 id="second_spec" value="1" name="second_spec" />启用商品多规格同时下单
								</label>
								<span class="help-block">启用商品规格后，商品的价格及库存以商品规格为准,库存设置为0则不显示,-1为不限制</span>
							</div>
						</div>

						<div id='tboption' style="display: none">
							<div class="alert alert-info">
								<!-- 1. 拖动规格可调整规格显示顺序, 更改规格及规格项后请点击下方的【刷新规格项目表】来更新数据。<br/> -->
								<!-- 2.  -->
								每一种规格代表不同型号，例如颜色为一种规格，尺寸为一种规格，如果设置多规格，手机用户必须每一种规格都选择一个规格项，才能添加购物车或购买。
							</div>
							<div id='specs'>

							</div>

							<table class="table">
								<tr>
									<td>
										<h4>
											<a href="javascript:;" class='btn btn-primary' id='add-spec'
												 onclick="addSpec()" style="margin-top: 10px; margin-bottom: 10px;" title="添加规格">
												<i class='fa fa-plus'></i> 添加规格
											</a>
											<a onclick="calc()" title="刷新规格项目表" class="btn btn-primary">
												<i class="fa fa-refresh"></i> 刷新规格项目表
											</a>
										</h4>
									</td>
								</tr>
							</table>

							<div class="panel-body table-responsive" id="options"
									 style="padding: 0;"></div>
						</div>
					</div>
					<!-- 商品规格部分  结束 -->

					<!-- 商品售卖区域部分  开始 -->
					<div class="tab-pane" id="tab_areas">
						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 control-label"
										 for="form-field-1"> 商品售卖区域</label>
							<div class="col-sm-9 col-xs-12">
								<div id="areas" class="form-control-static">长沙市;株洲市;湘潭市;岳阳市;</div>
								<a href="javascript:;" class="btn btn-default"
									 onclick="selectAreas()">选择地区</a> <input type="hidden"
																													 id="selectedareas" name="areas" value="长沙市;株洲市;湘潭市;" />
							</div>
						</div>

						<!-- <div class="form-group">
              <label class="col-sm-2 control-label no-padding-right"
                for="form-field-1"> 设置门店白名单: </label>
              <div class="col-sm-4">
                <div class="tags" style="width: 100%; min-height: 34px;">
                </div>
                <input type="hidden" name="tname_white_list"
                  id="tname_white_list" value="">
                <input type="hidden" name="tid_white_list" id="tid_white_list" value="">
              </div>
              <div class="col-sm-1">
                点击添加模态框（Modal）
                <button class="btn btn-sm btn-danger" type="button"
                  data-toggle="modal" data-target="#modal-teams"
                  onclick="headlist(0)">添加门店
                </button>
              </div>
            </div> -->

						<div id="modal-areas" class="modal fade" tabindex="-1" data-toggle="modal-areas">
							<div class="modal-dialog" style='width: 920px;'>
								<div class="modal-content">
									<div class="modal-header">
										<button aria-hidden="true" data-dismiss="modal" class="close"
														type="button">×</button>
										<h3>选择区域</h3>
									</div>
									<div class="modal-body" id="areas-modal-body" style='height: 280px;'>
										<div class='province'>
											<label class='checkbox-inline' style='margin-left: 20px;'>
												<input type='checkbox' class='cityall' style='margin-top: 12px;' />
												<span class="citycount" style='color: #ff6600'></span>
											</label>
										</div>
									</div>
									<div class="modal-footer">
										<a id='btnSubmitArea' class="btn btn-success" data-dismiss="modal"
											 aria-hidden="true">确定</a>
										<a class="btn btn-default" data-dismiss="modal"
											 aria-hidden="true">关闭</a>
									</div>
								</div>
							</div>
						</div>


						<div class="modal fade" id="modal-teams" tabindex="-1">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
														aria-hidden="true">×</button>
										<h4 class="modal-title">选择门店</h4>
									</div>
									<div class="modal-body">
										<div class="row">
											<div class="col-xs-12">
												<div class="form-group">
													<label class="col-sm-2 control-label no-padding-right"
																 for="form-field-1"> 门店名称： </label>
													<div class="col-sm-10">
														<input type="text" id="select_team_key"
																	 placeholder="输入门店名称/门店姓名/手机"
																	 class="col-xs-10 col-sm-5 admin_sea">
														<a class="btn btn-xs btm-input btn-purple"
															 onclick="headlist(0)">
															<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
															搜索
														</a>
													</div>
												</div>
												<div class="space-4"></div>
											</div>
										</div>
										<div class="row">
											<div class="col-xs-12">
												<div>
													<input name="p" id="p" value="1" type="hidden">
													<div class="table-responsive">
														<table class="table table-striped table-bordered table-hover">
															<thead>
															<tr>
																<th class="hidden-xs">ID</th>
																<th>门店</th>
																<th>门店名称</th>
																<th style="border-right: #CCC solid 1px;">操作</th>
															</tr>
															</thead>

															<tbody id="ajax-data1"></tbody>
														</table>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<!-- 商品售卖区域部分  结束 -->

				</div>
				<div class="form-group text-center">
					<div class="col-sm-8 col-sm-offset-2">
						<button class="btn btn-primary" onclick="saveProduct()">
							<i class="fa fa-check"></i>提交
						</button>
						<div class="btn btn-danger" onclick="reset()">
							<i class="fa fa-remove"></i> 重置
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</div>

<div th:include="centre/manage/include::footer"></div>
<script type="text/javascript" src="/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="/js/ueditor/custom.js?v=2"></script>
<script type="text/javascript" src="/js/appjs/product/AreaData.js"></script>
<script type="text/javascript" src="/public/ace/js/ace-extra.js"></script>
<script type="text/javascript" src="/js/plugins/layui/layui.js"></script>
<script type="text/javascript" src="/js/plugins/layer/layer.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script src="/js/jquery-select/jquery.searchableSelect.js"></script>
<script type="text/javascript">
	$(function(){
		/* $('#pcate').searchableSelect();
		$('#ccate ').searchableSelect(); */
		$('#supplierId').searchableSelect();
	});

	function closeDow() {
		var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
		parent.layer.close(index);
	}

	layui.use('laydate', function(){
		var laydate = layui.laydate;
		laydate.render({
			elem: '#timestart' , type: 'datetime'
		});

		laydate.render({
			elem: '#timeend' , type: 'datetime'
		});

		laydate.render({
			elem: '#upStartTime' , type: 'datetime'
		});

		laydate.render({
			elem: '#upEndTime' , type: 'datetime'
		});


	})


	function changeValue() {
		var	suggestsaleprice =  $("#suggestsaleprice").val();
		var	superiorcommission =  $("#superiorcommission").val();
		var  superiortype = $("#superiortype option:selected").val();
		if(superiortype==1){
			$("#superiorcommission").val(suggestsaleprice * (superiorcommission/100));
			$("#superiortype option:first").prop("selected", 'selected');
		}
	}

	function changeValue2() {
		var	suggestsaleprice =  $("#suggestsaleprice").val();
		var	usercommission =  $("#usercommission").val();
		var  superiortype = $("#usertype option:selected").val();
		if(superiortype==1){
			$("#usercommission").val(suggestsaleprice * (usercommission/100));
			$("#usertype option:first").prop("selected", 'selected');
		}
	}

	function changeValue3() {
		var	suggestsaleprice =  $("#suggestsaleprice").val();
		var	superusercommission =  $("#superusercommission").val();
		var  superiortype = $("#superusertype option:selected").val();
		if(superiortype==1){
			$("#superusercommission").val(suggestsaleprice * (superusercommission/100));
			$("#superusertype option:first").prop("selected", 'selected');
		}
	}

	function changeVal() {
		var	suggestsaleprice =  $("#suggestsaleprice").val();
		var	headcommission =  $("#headcommission").val();
		var  headtype = $("#headtype option:selected").val();
		if(headtype==1){
			$("#headcommission").val(suggestsaleprice * (headcommission/100));
			$("#headtype option:first").prop("selected", 'selected');
		}
	}

	$(function() {
		// tab切换
		$('#myTab a').click(function(e) {
			e.preventDefault();
			$('#myTab li').each(function() {
				$(this).removeClass('active')
			})
			$('.tab-content .tab-pane').each(function() {
				$(this).removeClass('active')
			})
			$(this).parent().addClass('active')
			id = $(this).attr('href')
			$(id).addClass('active');
		})

		// 是否开启门店佣金
		$("#is_fx_commission").click(function(){
			var obj = $(this);
			if (obj.get(0).checked){
				document.getElementById("superiorcommission").disabled=false;
				document.getElementById("headcommission").disabled=false;
				document.getElementById("usercommission").disabled=false;
				document.getElementById("superusercommission").disabled=false;
			}else{
				document.getElementById("superiorcommission").disabled=true;
				document.getElementById("headcommission").disabled=true;
				document.getElementById("usercommission").disabled=true;
				document.getElementById("superusercommission").disabled=true;
			}
		});

		// 启用商品多规格同时下单
		$("#second_spec").click(function(){
			var obj = $(this);
			var aDiv = document.getElementsByName('listspec');
			var aDivdel = document.getElementsByName('listspecdel');
			if (obj.get(0).checked){
				$("#listspecdel").hide();
				for(var i=0;i<aDiv.length;i++){
					aDiv[i].style.display="none";
					aDivdel[i].style.display="";
				}
			} else {
				for(var i=0;i<aDiv.length;i++){
					aDiv[i].style.display="";
					aDivdel[i].style.display="none";
				}
			}
		});

		// 是否按时间范围上架
		radioIsChecked();

		// 设置默认限卖时间
		var date = new Date();
		var year = date.getFullYear();
		var mon=date.getMonth()+1 < 10 ? "0"+ (date.getMonth()+1):(date.getMonth()+1);
		var da=date.getDate() < 10 ? "0"+ date.getDate():date.getDate();
		var h=date.getHours() < 10 ? "0"+ date.getHours():date.getHours();
		var m=date.getMinutes() < 10 ? "0"+ date.getMinutes():date.getMinutes();

		date.setDate(date.getDate()+1);
		var endyear = date.getFullYear();
		var endmon=date.getMonth()+1 < 10 ? "0"+ (date.getMonth()+1):(date.getMonth()+1);
		var endda=date.getDate() < 10 ? "0"+ date.getDate():date.getDate();
		var endh=date.getHours() < 10 ? "0"+ date.getHours():date.getHours();
		var endm=date.getMinutes() < 10 ? "0"+ date.getMinutes():date.getMinutes();
		$("#timestart").val(year+"-"+mon+"-"+da+" 20:30:00");
		$("#timeend").val(endyear+"-"+endmon+"-"+endda+" 20:00:00");
		$("#upStartTime").val(year+"-"+mon+"-"+da+" 20:00:00");
		$("#upEndTime").val(endyear+"-"+endmon+"-"+endda+" 20:00:00");
	})




	// $(function() {
	// 	//从js数据中获取地区
	// 	var areasModalBody = '';
	// 	for (var i = 0; i < provs_data.length; i++) {
	// 		console.log(provs_data[i]);
	// 		areasModalBody += "<div class='province'>";
	// 		areasModalBody += "<label class='checkbox-inline' style='margin-left:20px;'>";
	// 		areasModalBody += "<input type='checkbox' class='cityall' style='margin-top:12px;' />";
	// 		areasModalBody += provs_data[i].text;
	// 		areasModalBody += "<span class='citycount' style='color:#ff6600'></span>";
	// 		areasModalBody += "</label>";
	//
	// 		//获取省级下的所有市
	// 		if (citys_data[provs_data[i].value].length > 0) {
	// 			areasModalBody += "<ul>";
	// 			var citys = citys_data[provs_data[i].value];
	// 			for (var j = 0; j < citys.length; j++) {
	// 				//	alert(JSON.stringify(dists_data[citys[j].value]));
	//
	// 				areasModalBody += "<li>";
	// 				areasModalBody += "<label class='checkbox-inline' >";
	// 				areasModalBody += "<input type='checkbox' class='city' style='margin-top:8px;' city="+citys[j].text+" />";
	// 				areasModalBody += citys[j].text;
	// 				areasModalBody += "</label>";
	// 				areasModalBody += "</li>";
	// 			}
	// 			areasModalBody += "</ul>";
	// 		}
	//
	// 		areasModalBody += "</div>";
	// 	}
	// 	$("#areas-modal-body").html(areasModalBody);
	//
	// 	$('.province').mouseover(function() {
	// 		$(this).find('ul').show();
	// 	}).mouseout(function() {
	// 		$(this).find('ul').hide();
	// 	});
	//
	//
	// 	$('.cityall').click(function(){
	// 		var checked = $(this).get(0).checked;
	// 		var citys = $(this).parent().parent().find('.city');
	// 		citys.each(function(){
	// 			$(this).get(0).checked = checked;
	// 		});
	// 		var count = 0;
	// 		if(checked){
	// 			count =  $(this).parent().parent().find('.city:checked').length;
	// 		}
	// 		if(count>0){
	// 			$(this).next().html("(" + count + ")")    ;
	// 		}
	// 		else{
	// 			$(this).next().html("");
	// 		}
	// 	});
	// 	$('.city').click(function(){
	// 		var checked = $(this).get(0).checked;
	// 		var cityall = $(this).parent().parent().parent().parent().find('.cityall');
	//
	// 		if(checked){
	// 			cityall.get(0).checked = true;
	// 		}
	// 		var count = cityall.parent().parent().find('.city:checked').length;
	// 		if(count>0){
	// 			cityall.next().html("(" + count + ")")    ;
	// 		}
	// 		else{
	// 			cityall.next().html("");
	// 		}
	// 	});
	//
	// 	$('#btnSubmitArea').unbind('click').click(function(){
	// 		$('.city:checked').each(function(){
	// 			citystrs+= $(this).attr('city') +";";
	// 		});
	// 		$('.' + current + ' .cityshtml').html(citystrs);
	// 		$('.' + current + ' .citys').val(citystrs);
	// 	})
	//
	//
	// });


	// $(function(){
	// 	var x=document.getElementById("free_shipping").value;
	// 	show_type(x);
	// 	$(':radio[name=free_shipping]').click(function(){
	// 		var val = $(this).val();
	// 		show_type(val);
	// 	})
	// });



	$(function() {
		$("#hasoption").click(function() {
			var obj = $(this);
			if (obj.get(0).checked) {
				$("#tboption").show();
				$("#second_speccid").show();
			} else {
				$("#tboption").hide();
				$("#second_speccid").hide();
			}
		});
	})


</script>

</body>
</html>
